package com.zyzg.mapper;

import com.alibaba.fastjson2.JSONObject;
import com.zyzg.annotation.DataSource;
import com.zyzg.domain.*;
import com.zyzg.enums.DataSourceType;
import org.springframework.data.repository.query.Param;

import java.util.List;
import java.util.Map;

/**
 * @Author: lurui
 * @CreateTime: 2021-03-26 11:57
 * @Description: ${Description}
 */
public interface DataMapper {


    List<AppConfig> findAllAppConfig();

    List<NearbyCarInfoVo> getCodeByCarInfo(String[] codes);

    @DataSource(value = DataSourceType.SLAVE)
    List<JSONObject> getCardStates(String[] codes);

    @DataSource(value = DataSourceType.SLAVE)
    List<JSONObject> getSns(String[] codes);

    @DataSource(value = DataSourceType.SLAVE)
    EquipmentSn getSnByUidAndEquipmentId(EquipmentSnParam param);

    @DataSource(value = DataSourceType.SLAVE)
    EquipmentSn getSnByCode(String code);

    @DataSource(value = DataSourceType.SLAVE)
    String SeachEquipmentSn();

    @DataSource(value = DataSourceType.SLAVE)
    int saveEquipmentSn(EquipmentSn equipmentSn);

    @DataSource(value = DataSourceType.SLAVE)
    EquipmentSn getEquipmentSnById(Integer id);

    @DataSource(value = DataSourceType.SLAVE)
    int delEquipmentSnById(Integer id);

    @DataSource(value = DataSourceType.SLAVE)
    int updateEquipmentSn(EquipmentSn ec);

    int checkIsIntallDev(String code);

    List<LngLatEntity> selectNealrylnglat(Double lng, Double lat, Integer radius);

    List<NearbyCarListVo> selectNealryByConfigId(@Param("configIds") List<String> configIds, @Param("dvcId")String dvcId, @Param("brandId")String brandId, @Param("modelId")String modelId);
}
